/*
 * main.cpp
 *
 *  Created on: 24 déc. 2010
 *      Author: remz
 */
#include <iostream>
#include <string>
#include <iomanip>

#include "Humain/Player.h"
#include "Option/Option.h"


using namespace std;
using namespace rpg;

enum Classe {Soldat, Mage, Voleur};
enum Sexe {Homme, Femme};

string Classe[3] = {"Soldat", "Mage", "Voleur"};
string Sexe[2] = {"Homme", "Femme"};

int main(int argc, const char* argv[])
{

	cout <<setw(7) <<" ############################### \n";
	cout <<setw(7) <<" ###                         ### \n";
	cout <<setw(7) <<" ### Let's the battle begin! ### \n";
	cout <<setw(7) <<" ###			     ### \n";
	cout <<setw(7) <<" ############################### \n\n";

	cout << "Creation des combattant...\n\n";

	
	Player *Remz = new Player("Remz", Homme, Soldat, 1, 45, 25, 30, 150, 60, 20, 30, 0);
	Player *Oliv = new Player("Oliv", Femme, Voleur, 1, 30, 60, 30, 150, 60, 20, 10, 0);


	cout << "Le " << Classe[Remz->getClass()] << ' ' << Remz->getName() << " a ete cree !\n";
	cout << "Le " << Classe[Oliv->getClass()] << ' ' << Oliv->getName() << " a ete cree !\n\n";

	cout << "Le " << Classe[Remz->getClass()] << ' ' <<"Remz inflige " << Remz->Attack(false)
		<< " degats et son armure est de " << Remz->Defend() << "\n\n";

	cout << "Stat du " << Classe[Remz->getClass()] <<" Remz :\n";
	cout << "Sexe   : " << Sexe[Remz->getSexe()] << endl;
	cout << "Level  : " << Remz->getLevel() << endl;
	cout << "Str    : " << Remz->getStr()   << endl;
	cout << "Dext   : " << Remz->getDext() << endl;
	cout << "Int    : " << Remz->getInt() << endl;
	cout << "Hp     : " << Remz->getHp() << endl;
	cout << "Mp     : " << Remz->getMp() << endl;
	cout << "Weapon : " << Remz->getWeapon() << endl;
	cout << "Armor  : " << Remz->getArmor() << endl;
	cout << "Xp     : " << Remz->getXp() << endl << endl;



	cout << "Le " << Classe[Oliv->getClass()] << ' ' <<"Oliv inflige " << Oliv->Attack(false)
		<< " degats et son armure est de " << Oliv->Defend() << "\n\n";

	cout << "Stat du " << Classe[Oliv->getClass()] <<" Oliv :\n";
	cout << "Sexe   : " << Sexe[Oliv->getSexe()] << endl;
	cout << "Level  : " << Oliv->getLevel() << endl;
	cout << "Str    : " << Oliv->getStr()   << endl;
	cout << "Dext   : " << Oliv->getDext() << endl;
	cout << "Int    : " << Oliv->getInt() << endl;
	cout << "Hp     : " << Oliv->getHp() << endl;
	cout << "Mp     : " << Oliv->getMp() << endl;
	cout << "Weapon : " << Oliv->getWeapon() << endl;
	cout << "Armor  : " << Oliv->getArmor() << endl;
	cout << "Xp     : " << Oliv->getXp() << endl << endl;
	
	
	int rep;
	cout << "Voulez vous changer la Classe du " <<  Classe[Remz->getClass()] << " Remz ? (1 pour oui, 0 pour non)\n";
	cin >> rep;

	if (rep == 1)
	{
		int cl;
		cout << endl;
		p:
		cout << "En quel Classe voulez vous changer Remz ? (0 pour Soldat, 1 pour Mage et 2 pour Voleur\n\n";
		cin  >> cl;
		if ((cl > 1) || (cl > 2))
		{
			cout << "\nErreur de commande : 0 = Soldat, 1 = Mage, 2 = Voleur\n";
			goto p; //goto a virer trop moche et sert a rien -- Remi a raison trop moche le goto !
			
		}
		cout << endl;
		Remz->setClass(cl);	
		cout << "Le " << Classe[Remz->getClass()] << " Remz inflige maintenant " << Remz->Attack(false) << endl;
	}	

	cout << "Sauvegarde du joueur Remz en cours\n";
	rpg::Option::Save(*Remz);

	/*int str;
	cout << "\n nouvelle caracteristique Str : ";
	cin >> str;
	Remz->setStr(str);
	cout << "\nStr = " << Remz->getStr();
	*Remz = rpg::Option::Load(); //load mettre le pseudo en parametre et faire un getline() pour prendre toute les donnees le concernant.
	cout << "\napres load str = " << Remz->getStr();

	rpg::Option::Pause(*Remz);

	cout << "Cheatgod qui met ton xp a 120\n";
	Remz->setXp(120);*/

	return 0;
}
